package com.dragonwu.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author DragonWu
 * @date 2022-09-30 16:28
 **/
@RestController
@RequestMapping("/test")
@RefreshScope //开启实时刷新
public class TestController {

    @Value("${person.name}")
    String name;

    @Value("${person.age}")
    Integer age;

    @GetMapping
    public String test(){
        return name+"的年龄是"+age+"岁";
    }

}
